package stater

import (
	// "bp/cache"
	"bp/conf"
	"bp/db"
	"bp/internal/service/entity"
	"go.uber.org/zap"
)

type StaterComServiceImp struct {
	dao                   *db.PgDao
	slog                  *zap.SugaredLogger
	vars                  *conf.VarsSection
	entityHub             *entity.EntityHub
	memberGotCouponNotifyChans []chan *NMemberGotCoupon
}

// New initialization
func New(
	pgdao *db.PgDao,
	slog *zap.SugaredLogger,
	vars *conf.VarsSection,
	entityHub *entity.EntityHub,
) (s *StaterComServiceImp) {
	s = &StaterComServiceImp{
		dao:       pgdao,
		slog:      slog.With("module", "StaterComService"),
		vars:      vars,
		entityHub: entityHub,
	}
	// 后期可以使用配置来决定worker数量
	s.memberGotCouponNotifyChans = s.runMemberGotCouponStatWorkers(2)
	return
}

